package org.checkboo.math;

final public class FloatMath {
	
	/**
	 * Float value of PI
	 */
	public static final float FLOAT_PI = (float) Math.PI;
	
	/**
	 * Method for computing square of the supplied value
	 * @param value
	 * @return square of the supplied value
	 */
	public static float sqr(float value){
		return value*value;
	}
	
	/**
	 * Method for computing square root of the supplied value
	 * @param value
	 * @return square root of the supplied value
	 */
	public static float sqrt(float value){
		return (float) Math.sqrt(value);
	}
	
	/**
	 * Method converting angle in degrees to radians
	 * @param degrees
	 * @return radians
	 */
	public static float degToRad(float degrees){
		return (float) degrees*(FLOAT_PI/180);
	}
	
	/**
	 * Method converting angle in radians to degrees
	 * @param radians
	 * @return degrees
	 */
	public static float radToDeg(float radians){
		return (float) radians*(180/FLOAT_PI);
	}

	/**
	 * Method for computing sine value of supplied angle
	 * @param angle
	 * @return sin(angle)
	 */
	public static float sin(float angle){
		return (float) Math.sin(angle);
	}
	
	public static float asin(float value){
		return (float) Math.asin(value);
	}
	
	/**
	 * Method for computing cosine value of supplied angle
	 * @param angle
	 * @return cos(angle)
	 */
	public static float cos(float angle){
		return (float) Math.cos(angle);
	}
	
	public static float acos(float value){
		return (float) Math.acos(value);
	}
	
	public static float tan(float angle){
		return (float) Math.tan(angle);
	}
	
	public static float atan(float value){
		return (float) Math.atan(value);
	}
	
	public static float atan2(float x, float y){
		return (float) Math.atan2(y, x);
	}
}
